import request from '@/utils/request'
import axios from 'axios'
import { api } from './config'

export function getAnswerItemList(params){
    return request({
        url : '/answerItem/list',
        method : 'get',
        params
    })
}

export function saveAnswerItem(data){
    return request({
        url : '/answerItem/save',
        method : 'post',
        data
    })
}

export function testAnswerItem(data){
    return request({
        url : '/answerItem/test',
        method : 'post',
        data
    })
}

export function getAnswerItemDetail(params){
    return request({
        url : '/answerItem/detail/' + params,
        method : 'get',
    })
}

export function exportExcelAnswerItemList(params){
    return axios({
        url : api + '/answerItem/export',
        method : 'get',
        headers : {
            responseType: 'blob',
            token : localStorage.getItem('token')
        },
        params
    })
}

export default {
    getAnswerItemList,
    saveAnswerItem,
    testAnswerItem,
    exportExcelAnswerItemList,
    getAnswerItemDetail
};